# 带参数的装饰器,在基础函数上多嵌套一层函数，返回装饰器

def parameters(n):
    def generator(func):
        def wrapper(*args, **kwargs):
            print("装饰前的操作")
            print(f"传入的参数为{n}")
            result = func(*args, **kwargs)
            print("装饰后的操作")
            return result

        return wrapper

    return generator


@parameters("beat")
def brow():
    print("beat下的单词有: offbeat upbeat downbeat browbeat brown browse")


if __name__ == '__main__':
    brow()
